/*
 * Copyright(c) 2018-? the original author[Wien(luweien@aliyun.com)] or authors.
 *
 */
package org.doll.it.web.controller;

import org.doll.it.base.constant.DefaultConsts;
import org.doll.it.base.util.ResultUtils;
import org.doll.it.base.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiOperation;

/**
 * 首页
 * 
 * @author Wien(luweien@aliyun.com)
 *
 */
@RestController
public class IndexController {

	@Autowired
	private Environment env;

	/**
	 * 默认首页
	 * @return
	 */
	@GetMapping
	@ApiOperation(value = "默认首页", notes = "默认首页，默认欢迎页")
	public ResultVO<String> index() {
		String appName = env.getProperty(DefaultConsts.SPRING_APPLICATION_NAME);
		return ResultUtils.newSuccess("Welcome to use " + appName);
	}
}
